package com.H1023.service;

import com.H1023.dao.LendMapper;
import com.H1023.pojo.Book;
import com.H1023.pojo.Lend;
import com.H1023.pojo.Reader;
import com.H1023.pojo.Remand;

import java.util.List;

public class LendServiceImpl implements LendService{


    private LendMapper lendMapper;

    public void setLendMapper(LendMapper lendMapper) {
        this.lendMapper = lendMapper;
    }


    //查询仓库中所有的图书信息
    public List<Book> selectAllBook(){
        return lendMapper.selectAllBook();
    }

    @Override
    public Book selectBookById(int bookid) {
        return lendMapper.selectBookById(bookid);
    }


    //查询借阅者的信息
    public List<Lend> selectAllLenderById(int readerid){
        return lendMapper.selectAllLenderById(readerid);
    }

    @Override
    public List<Lend> selectAllLender() {
        return lendMapper.selectAllLender();
    }

    @Override
    public List<Lend> selectLendNoteByBookId(int bookid) {
        return lendMapper.selectLendNoteByBookId(bookid);
    }

    @Override
    public List<Lend> selectRepetitive(Lend lend) {
        return lendMapper.selectRepetitive(lend);
    }

    @Override
    public int selectLendState(Lend lend) {
        return lendMapper.selectLendState(lend);
    }

    @Override
    public Reader selectReaderById(int readerId) {
        return lendMapper.selectReaderById(readerId);
    }

    @Override
    public int updateBookCount(int bookid) {
        return lendMapper.updateBookCount(bookid);
    }

    @Override
    public int insertLendNote(Lend lend) {
        return lendMapper.insertLendNote(lend);
    }

    @Override
    public int deleteLendNote(Lend lend) {
        return lendMapper.deleteLendNote(lend);
    }

    @Override
    public int deleteLendNote2(Lend lend) {
        return lendMapper.deleteLendNote2(lend);
    }

    @Override
    public int deleteRemandNote(Remand remand) {
        return lendMapper.deleteRemandNote(remand);
    }

    @Override
    public List<Book> queryBookByName(String bookName) {
        return lendMapper.queryBookByName(bookName);
    }


}
